Skip to content

Instantly share code, notes, and snippets.

View eyecatchup's full-sized avatar

Stephan Schmitz eyecatchup

View GitHub Profile
@eyecatchup
eyecatchup / simple_xml_iterator.php
Created February 6, 2016 15:25 — forked from ArnaudLigny/simple_xml_iterator.php
PHP SPL SimpleXMLIterator examples
<?php
try {
$sxe = simplexml_load_string($xmlstring, 'SimpleXMLIterator');
for ($sxe->rewind(); $sxe->valid(); $sxe->next()) {
if ($sxe->hasChildren()) {
foreach ($sxe->getChildren() as $element=>$value) {
echo $value->species . '<br />';
}
}
}
@eyecatchup
eyecatchup / gist:f30661eda33976b6602d
Created February 6, 2016 15:37 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@eyecatchup
eyecatchup / gist:ba92d97c9b81f3b9fb95
Created February 7, 2016 06:17 — forked from hannu/gist:4604611
Filter your own commit messages from git log and group by day. (Modified from http://stackoverflow.com/questions/2976665/git-changelog-day-by-day)
#!/bin/bash
AUTHOR=$(git config user.name)
DATE=$(date +%F)
git log --no-merges --format="%cd" --date=short --no-merges --author="$AUTHOR" --all | sort -u -r | while read DATE ; do
if [ $NEXT != "" ]
then
echo
echo [$NEXT]
fi
GIT_PAGER=cat git log --no-merges --format=" %s" --since=$DATE --until=$NEXT --author="$AUTHOR" --all
@eyecatchup
eyecatchup / fs.js
Created February 13, 2016 06:00 — forked from ukyo/fs.js
tiny requestFileSytem Wrapper
//tiny requestFileSystem Wrapper
//author @ukyo
//apache license
//refer: http://d.hatena.ne.jp/shirokurostone/20111014/1318593601
var fs = (function(window){
var fs = {},
BlobBuilder = window.WebKitBlobBuilder || window.MozBlobuilder || window.MSBlobBuilder,
requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem,
@eyecatchup
eyecatchup / gist-toc.js
Last active March 7, 2019 21:57 — forked from ukyo/gist-toc.js
toc tree for gist
(function(l, l2, s) {
l2 = l2 || 6;
NodeList.prototype.forEach = [].forEach;
NodeList.prototype.slice = [].slice;
var toc = document.createElement('div');
var headerLevel = l || 2;
var tocStyle = s || 'ul';
@eyecatchup
eyecatchup / SCSS.md
Created February 15, 2016 20:19 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@eyecatchup
eyecatchup / logger.js
Created February 16, 2016 11:50 — forked from jareware/logger.js
Simple utility for unified logging to the console, with optional timestamping.
/**
* Simple utility for unified logging to the console, with optional timestamping.
*
* @example // Create several loggers around the application:
* var log = logger.create('main');
* var logInAnotherModule = logger.create('anotherModule');
*
* // Call the created loggers:
* log('Application started');
* logInAnotherModule('Module started');
@eyecatchup
eyecatchup / namespaceRefactor.php
Created February 18, 2016 13:21 — forked from hpbuniat/namespaceRefactor.php
Super-simple script to convert a existing project to use namespaces
<?php
/**
* Super-simple script to convert a existing project to use namespaces
*
* @author Hans-Peter Buniat <[email protected]>
* @copyright 2012 Hans-Peter Buniat <[email protected]>
* @license http://opensource.org/licenses/BSD-3-Clause
*/
class namespaceRefactor {
index.php: The Main component of CTB-Locker for Websites and contains the encryption and decryption routines as well as the payment page.
allenc.txt: Contains a list of all encrypted files.
test.txt: Contains the path and filenames to two prechosen files that can be decrypted for free.
victims.txt: It contains a list of all files that are to be encrypted. However, the files that are already encrypted will remain in this list.
extensions.txt: - The list of file extensions that should be encrypted.
secret_[site_specific_string]: The secret file used by the Free Decrypt and Chat functions and is located in the same folder as the index.php file.
Via:
http://erdeni.ru/access.php
http://studiogreystar.com/access.php