Skip to content

Instantly share code, notes, and snippets.

Avatar
🇨🇦
Use AGPL

Sean AlbinoDrought

🇨🇦
Use AGPL
View GitHub Profile
@AlbinoDrought
AlbinoDrought / GarglC#
Created Feb 10, 2015
Example C# Gargl output of yahoo template
View GarglC#
using System;
using System.Net;
using System.IO;
public class YahooSearch
{
public string Autocomplete (string term)
{
string url = "http://sugg.search.yahoo.com/gossip-us-fp/" + "?output=yjsonp&nresults=10&version=&command=" + term + "&queryfirst=2";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
View gist:70fae7d134026df1bd38
using System;
using System.Net;
using System.IO;
public class Sample-Site
{
public string Function1 (string topic,string variableParamValue,string subtopic)
{
string url = "http://www.samplesite.com/@topic@/@subtopic@" + "?staticParam=value1&variableParam=" + variableParamValue + "";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
@AlbinoDrought
AlbinoDrought / css_only_separators.html
Created Jul 29, 2016
Separate elements only if both are not empty, using only CSS
View css_only_separators.html
<html>
<head>
<style type="text/css">
.s:not(:empty)+.s:not(:empty):before {
content: " / ";
}
</style>
</head>
<body>
<div>
View aliases.bashrc
# For all those forgetful people....
alias where='echo "You probably mean \"whereis\"!"; whereis'
@AlbinoDrought
AlbinoDrought / auto-colorize.less
Created Sep 26, 2016
Auto-generate contrasted color pairs with LESS
View auto-colorize.less
@contrast-level: 85%;
.auto-colorize(@text-color) {
color: @text-color;
// pick the color with the most contrast to our text color
// _should_ at least be readable with light colors
background-color: contrast(
@text-color,
shade(@text-color, @contrast-level),
@AlbinoDrought
AlbinoDrought / hackmud_rainbow.js
Created Sep 28, 2016
Turns a number (0 <= i <= 52) into a hackmud-compatible color code.
View hackmud_rainbow.js
/*
Using color codes:
`0message`
`1message`
`amessage`
`Amessage`
The game matches the following regex:
`(?:([0-9])|([a-z])|([A-Z]))(.+?)`
*/
View ifset.php
<?php
/*
with all the esoteric functions PHP has, you would think they would also have something like this:
*/
function ifset($array, $key, $ifnotset = null) {
if(isset($array[$key])) return $array[$key];
return $ifnotset;
@AlbinoDrought
AlbinoDrought / deploy.php
Last active Apr 17, 2017
Deploying PHP to a Cygwin Windows machine using Deployer (deployer.org)
View deploy.php
function decygwin($path) {
return preg_replace('/\/cygdrive\/(\D)\//', '$1:/', $path);
}
// use native symlinks, because non-native cygwin symlinks are not "directories": `is_dir('cygwin-symlink') == false`
set('env_vars', 'CYGWIN="winsymlinks:nativestrict"');
// cygwin release path fix
// replaces the cygwin release path (/cygdrive/c/) with the windows release path (C:/)
// increases compatibility with things like non-cygwin PHP for composer installs
View automatic-tab-closer.js
// ==UserScript==
// @name Automatic Tab Closer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description No more tab hogging ;)
// @author AlbinoDrought
// @match *://www.w3schools.com/*
// @match *://php.net/*
// @match *://www.google.ca/*
// @grant window.close
View ren-and-stimpy.bashrc
paste <(fortune | cowsay -f ren) <(fortune | cowsay -f stimpy) | pr -t -e100