Skip to content

Instantly share code, notes, and snippets.

View shahzeb1's full-sized avatar
🛠️
building

Shahzeb K. shahzeb1

🛠️
building
View GitHub Profile
-------Frameworks------
EmberJS
AngularJS
React
Flight
BackboneJS / UnderscoreJS <- Use lodash instead of underscore
-------Build Tools-----
#include <iostream>
#include "Time.h"
Time::Time()
{
} // Time()
Time::void update()
{
@xeoncross
xeoncross / record.php
Last active December 15, 2015 10:39
Record audio from flash to MP3 using PHP
<?php
// https://code.google.com/p/wami-recorder/
# Save the audio to a URL-accessible directory for playback.
parse_str($_SERVER['QUERY_STRING'], $params);
$name = isset($params['name']) ? $params['name'] : 'output.wav';
$content = file_get_contents('php://input');
$fh = fopen($name, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);
@jed
jed / README.md
Last active December 27, 2015 15:09
Use U+200B to evade Twitter's DM malware flagging

Use this bookmarklet to escape the URL of the current page and evade Twitter's broken malware link flagging. It prepends all periods with a zero-width space, which Chrome, Firefox, and Safari all seem to ignore. Twitter's server won't recognize it as a link (yet), but the Twitter client will, which means it remains clickable in the DM pane.

For example: https://twitter.com/ will get flagged as malware in a DM, while https://twitter​.com/ won't. They look the same, but the latter has a ZWSP before the . in .com.

anonymous
anonymous / loghn.pl
Created December 13, 2014 11:01
use HTML::FromANSI ();
open (LOG, '>>hnchatlog.html');
select((select(LOG), $|=1)[0]);
print LOG "<body bgcolor=black>\n";
while (<>) {
my $h = HTML::FromANSI->new();
print LOG $h->ansi_to_html($_), "\n";
}
// - Draw a series of points in a straight line and draw a line between them;
// - Make a copy of the preceding series of points, slightly mutate their x/y coordinates, and draw a line between them;
// - Repeat
ArrayList<PVector> points;
int pTotal = 300; // The total number of points per line
float w; // This will be used to define the drawing area
// Noise variables
float offsetX = 0;
@tj
tj / Makefile
Last active March 11, 2017 13:31
imgix favicons
IMAGE_CDN = https://apex-inc.imgix.net
# Imgix image replacement.
images:
@echo "==> pointing images to $(IMAGE_CDN)"
@find build -type f -name "*.html" | xargs sed -i '' 's|src="/images|src="$(IMAGE_CDN)/images|g'
@find build -type f -name "*.html" | xargs sed -i '' 's|href="/images|href="$(IMAGE_CDN)/images|g'
.PHONY: images
@timbergus
timbergus / server.js
Created June 19, 2013 07:43
Basic node.js server without express, returning HTML contents instead plain text.
var http = require('http');
var port = 8080;
var server = http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/html'});
response.write('<h1>Hello World!</h1>');
response.end();
});
server.listen(port, function() {
/*
Meteor allows you to store functions on the server for handling things like data.
This is the server-side component to the Meteor.call() example in add-taco.js.
*/
Meteor.methods({
// Define our method. Note, we're passing an argument for the tacoToInsert value we passed to our Meteor.call() method.
'addTaco': function(tacoName){
// Here we do our insert again.
Tacos.insert({
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;