Skip to content

Instantly share code, notes, and snippets.

View atomize's full-sized avatar
🎹
♩♩

Berti atomize

🎹
♩♩
View GitHub Profile
@atomize
atomize / PHPinJSinHTML.html
Created April 4, 2013 03:24
php in js in html
<html>
<head>
<script type="text/javascript">
var myData = Array(); //create the blank array variable
//now add values to the array from PHP
<?php
@atomize
atomize / BuildQueryFromCheckBoxes.php
Last active December 15, 2015 18:59
Build MySQL query from checkboxes.
<?php
include("MYSQL2JSON.class.php");
//MySQL connect
$c = mysql_connect("useawsfordbduuuh.c345tgxpm1uqz.us-east-1.rds.amazonaws.com", "login", "password!");
mysql_select_db("database");
$json = new MYSQL2JSON(); //Create an object
$form = '<FORM
<form action="index.php" method="post">
<label><input type="checkbox" name="col[]" value="Asphalt">Asphalt</label><br>
@atomize
atomize / run.php
Created April 8, 2013 23:52 — forked from greut/run.php
#!/usr/bin/env php
<?php
$app = function($request) {
$body = <<<EOS
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<title>Hello World!</title>
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example:
@atomize
atomize / RemoveDupes
Created November 6, 2013 17:30
Outputs non-duplicate column data for all columns based on specfied input [column 1, in example code. Removes duplicates.
' !x[$1]++'
@atomize
atomize / customCSScursor.css
Created February 20, 2017 18:37
Give a custom cursor with CSS over all DOM elements, or even just some DOM elements.
*{cursor:url("//URI.to.customcursor.png"),default!important}*
body a,.arrow,button,a.progress,div.expando-button{cursor:url("//URI.to.customcursor.png"),!important}
@atomize
atomize / ffmpeg to webm.sh
Created March 4, 2017 07:29
ffmpeg mov to webm
ffmpeg -i $(IN) -c:v libvpx -pass 1 -an -f rawvideo -y /dev/null # Generates ffmpeg2pass-0.log
ffmpeg -i $(IN) -c:v libvpx -pass 2 -f webm -b:v 400K -crf 10 -an -y $(OUT).webm
@atomize
atomize / gist.cmd.txt
Created March 9, 2017 08:09
Testing a gist from the command line
Testing gist command line
@atomize
atomize / SambaRestartGraceful.sh
Created March 9, 2017 19:26
Graceful samba reload to recognize changes to smb.conf without restart, as root:
#RUN AS ROOT
# To get samba to recognize changes to its smb.conf *without restart*, as root:
# 1) First test your configuration file for errors:
testparm /path/to/smb.conf; echo $?
#If it exits '0' you're good to go.
# 2) Find the parent SMBD
ps -ef | grep smbd