Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@creaktive
creaktive / wifi_rebooter.sh
Created October 28, 2015 09:27
*/1 * * * * /usr/local/bin/wifi_rebooter.sh
#!/bin/bash
# The IP for the server you wish to ping (8.8.8.8 is a public Google DNS server)
SERVER=8.8.8.8
# Only send two pings, sending output to /dev/null
ping -c2 ${SERVER} > /dev/null
# If the return code from ping ($?) is not 0 (meaning there was an error)
if [ $? != 0 ]
anonymous
anonymous / test.curl.pl
Created September 18, 2015 20:05
#!/usr/bin/env perl
package CurlEasy;
use strict;
use utf8;
use Moo;
use Net::Curl::Easy qw(/^CURLOPT_/);
extends 'AnyEvent::Net::Curl::Queued::Easy';
1000 北海
1008 社会
1053 海道
1110 現在
1117 場合
1123 利用
1124 体人
1125 世界
1135 大学
1144 都市
@KonradIT
KonradIT / readme.md
Last active June 12, 2025 10:51
GoPro Studio for Linux
#!/bin/sh
SEP=
SEPE=
CLOCK=⌚
CALENDAR=☼
MUSIC=♫
WIDTH=${1}
@lukasvermeer
lukasvermeer / add_one_letter.pl
Last active December 28, 2015 21:19
Quick and dirty hack to find alternative sentences that can be created by adding a single letter to an input sentence. Probably only works on Mac (because it expects a dictionary file in a specific place).
use strict;
use warnings;
die "Malfunction. Need input." unless $ARGV[0];
open(W, "/usr/share/dict/words");
my @w;
while (my $line = <W>) {
chomp($line);
push(@w, lc($line));
@philfreo
philfreo / gist:7257723
Created October 31, 2013 21:44
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@jcarsique
jcarsique / wtf-did-i-do
Last active February 24, 2022 16:05
"WTF did I do?!" from https://coderwall.com/p/saylrw
#!/bin/bash
function usage() {
echo 'Usage: wtf-did-i-do {options}'
echo
echo 'OPTIONS:'
echo " -a author/committer; '' is allowed (defaults to $USER)"
echo ' -s since such date (defaults to 7.days.ago)'
echo ' -u until such date (defaults to today)'
echo ' -m directories max depth recurse (defaults to 1)'
@kg4sgp
kg4sgp / gortzelfsk.c
Created July 3, 2013 05:55
a goertzel demodulator
// Goertzel Demodulator
//
// This program demodulates two tone FSK using the goertzel algorithm.
#include <stdio.h>
#include <math.h>
struct gConstants {
float f1norm;
float f2norm;