Skip to content

Instantly share code, notes, and snippets.

View nullifiedaccount3's full-sized avatar
๐Ÿ‘‘
Killing it

nullifiedaccount3

๐Ÿ‘‘
Killing it
View GitHub Profile
@nullifiedaccount3
nullifiedaccount3 / recursiveadd.js
Created March 3, 2015 10:11
Recursive addition
function add(a, b) {
while (b !== 0) {
a = a + 1;
b = b - 1;
add(a, b);
}
return a;
}
console.log(add(10, 15));
<?php
$i=1;
while($i<=100){
if($i%3==0){
echo "Fizz";
if($i%5==0){
echo "Buzz<br>";
}
else{
echo "<br>";
@nullifiedaccount3
nullifiedaccount3 / lists-subcribe
Created April 9, 2014 10:16
mailchimp api example
{
"apikey": "your apikey",
"id": "list id",
"email": {
"email": $_POST["email_from _form"],
},
"merge_vars": {
"new-email": "example new-email",
"groupings": [
{
@nullifiedaccount3
nullifiedaccount3 / 3.php
Last active August 29, 2015 13:57
Little Jhool - the Devdas
<?php
/*
* Read input from stdin and provide input before running code
fscanf(STDIN, "%s\n", $name);
echo "Hi, ".$name;
*/
# Logfile created on 2014-02-12 16:13:58 -0500** [Airbrake] Notifier 3.1.12 ready to catch errors
[ESC][4;36;1mSQL (0.2ms)[ESC][0m [ESC][0;1mSET SQL_AUTO_IS_NULL=0[ESC][0m
[ESC][4;35;1mSQL (0.4ms)[ESC][0m [ESC][0mSHOW TABLES[ESC][0m
[ESC][4;36;1mSQL (37.0ms)[ESC][0m [ESC][0;1mCREATE TABLE `appearances` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `voter_id` int(11), `site_id` int(11), `prompt_id` int(11), `question_id` int(11), `lookup` varchar(255), `created_at` datetime, `updated_at` datetime, `answerable_id` int(11), `answerable_type` varchar(255), `valid_record` tinyint(1) DEFAULT 1, `validity_information` varchar(255)) ENGINE=InnoDB[ESC][0m
[ESC][4;35;1mSQL (0.8ms)[ESC][0m [ESC][0mSHOW KEYS FROM `appearances`[ESC][0m
[ESC][4;36;1mSQL (53.8ms)[ESC][0m [ESC][0;1mCREATE INDEX `index_appearances_on_answerable_id_and_answerable_type` ON `appearances` (`answerable_id`, `answerable_type`)[ESC][0m
[ESC][4;35;1mSQL (0.7ms)[ESC][0m [ESC][0mSHOW KEYS FROM `appearances`[ESC][0m
[E
@nullifiedaccount3
nullifiedaccount3 / log_file_1k
Last active August 29, 2015 13:56
aoi+pairwise log
# Logfile created on 2014-02-12 13:57:17 -0500DEPRECATION WARNING: Kernel#returning has been deprecated in favor of Object#tap. (called from enable_activerecord at /opt/allourideas/vendor/ruby/1.9.1/gems/will_paginate-2.3.14/lib/will_paginate.rb:39)
** [Airbrake] Notifier 3.1.12 ready to catch errors
[ESC][4;36;1mSQL (0.3ms)[ESC][0m [ESC][0;1mSET SQL_AUTO_IS_NULL=0[ESC][0m
[ESC][4;35;1mSQL (410.3ms)[ESC][0m [ESC][0mSHOW TABLES[ESC][0m
[ESC][4;36;1mSQL (2995.0ms)[ESC][0m [ESC][0;1mDROP TABLE `alternatives`[ESC][0m
[ESC][4;35;1mSQL (171.3ms)[ESC][0m [ESC][0mCREATE TABLE `alternatives` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `experiment_id` int(11), `content` varchar(255), `lookup` varchar(32), `weight` int(11) DEFAULT 1, `participants` int(11) DEFAULT 0, `conversions` int(11) DEFAULT 0) ENGINE=InnoDB[ESC][0m
[ESC][4;36;1mSQL (2.0ms)[ESC][0m [ESC][0;1mSHOW KEYS FROM `alternatives`[ESC][0m
[ESC][4;35;1mSQL (68.6ms)[ESC][0m [ESC][0mCREATE INDEX `index_alternatives_on_experime
#!/bin/bash
# HAVE A LOOK AT https://gist.github.com/3135855 FIRST ON HOW THIS WORKS
# keyring_password.sh [ "name of key" [, "store-this_Password ]]
# It either echoes the stored password, or stores a new item
if [ ! "$1" ]; then
exit 1
fi
_PWNAME="$1" # A placeholder name for this password in the keychain
#!/bin/bash
# HAVE A LOOK AT https://gist.github.com/3135855 FIRST ON HOW THIS WORKS
# keyring_password.sh [ "name of key" [, "store-this_Password ]]
# It either echoes the stored password, or stores a new item
if [ ! "$1" ]; then
exit 1
fi
_PWNAME="$1" # A placeholder name for this password in the keychain
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc != 2) {
printf("Usage: Amount in rupee(s)\n");
return 1;
}
int totalPaise = atoi(argv[1]) * 100, totalCombos = 0, lessThanThree;