Skip to content

Instantly share code, notes, and snippets.

@KleskBY
KleskBY / reset.cfg
Created September 6, 2022 12:30
Counter-strike 1.6 CS 1.6 Factory reset CFG (ALL CVARS)
echo "Reset every console variable to its default state. Dumped out of the game"
echo "Protocol version 48"
echo "Exe version 1.1.2.7/Stdio (cstrike)"
echo "Exe build: 19:53:27 Aug 3 2020 (8684)"
echo "Can be used for viewing default cvar values and fixing CS without reinstalling the game."
unbindall
bind "TAB" "+showscores"
bind "ENTER" "+attack"
@MichelleDalalJian
MichelleDalalJian / py4e_ex_11
Created October 7, 2017 14:48
Extracting Data With Regular Expressions Finding Numbers in a Haystack In this assignment you will read through and parse a file with text and numbers. You will extract all the numbers in the file and compute the sum of the numbers. Data Files We provide two files for this assignment. One is a sample file where we give you the sum for your testi…
import re
hand = open("regex_sum_24962.txt")
x=list()
for line in hand:
y = re.findall('[0-9]+',line)
x = x+y
sum=0
for z in x:
@Yaffle
Yaffle / gist:1287361
Last active April 27, 2024 04:19
crc 32 in javascript
function crc32(s/*, polynomial = 0x04C11DB7, initialValue = 0xFFFFFFFF, finalXORValue = 0xFFFFFFFF*/) {
s = String(s);
var polynomial = arguments.length < 2 ? 0x04C11DB7 : (arguments[1] >>> 0);
var initialValue = arguments.length < 3 ? 0xFFFFFFFF : (arguments[2] >>> 0);
var finalXORValue = arguments.length < 4 ? 0xFFFFFFFF : (arguments[3] >>> 0);
var table = new Array(256);
var reverse = function (x, n) {
var b = 0;
@ncornette
ncornette / .xinitrc
Created December 4, 2014 09:15
.xinitrc for kiosk mode
#!/bin/sh
# invoke global X session script
#. /etc/X11/Xsession
# HOW-TO :
# 1. Disable any Display Manager (lightdm/gdm/gdm3) from executing on startup
# 2. Allow user to start X :
# a. Edit /etc/X11/Xwrapper.config
# b. Set value : "allowed_users=anybody"
# 3. insert "su kiosk -c xinit &" into /etc/rc.local
@yvele
yvele / get-npm-package-version.sh
Last active April 27, 2024 04:19
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION
@jmshal
jmshal / designer.html
Created August 15, 2014 23:22
designer
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
// Red
$color-red-50: #fde0dc;
$color-red-100: #f9bdbb;
$color-red-200: #f69988;
$color-red-300: #f36c60;
$color-red-400: #e84e40;
$color-red-500: #e51c23;
$color-red-600: #dd191d;
$color-red-700: #d01716;
$color-red-800: #c41411;
// Created by Max Luster (@maxluster)
// Usage instructions at https://bugsnag.com/blog/responsive-typography-with-chained-media-queries
// Requires SASS >= 3.3
// Enhanced by Breakpoint 2.4.x and Compass 1.0 (alpha)
// For SASS 3.2.x support, use https://gist.github.com/maxluster/c9ecc6e4a6770e507c2c
// Provides a simplified syntax for chaining media queries across named or numeric breakpoints
@mixin responsive($properties, $default-value, $responsive-values){
// No named breakpoints by default
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
Uncaught TypeError: Cannot set property 'exports' of undefined main.js:9200
defineExport main.js:9200
browserifyShim main.js:9198
browserifyShim main.js:9200
(anonymous function) main.js:9204
require.AyKrkQ main.js:9206
s main.js:1
(anonymous function) main.js:1
require../core/button.js main.js:9215
s main.js:1