Skip to content

Instantly share code, notes, and snippets.

@pascalwhoop
pascalwhoop / gist:08bc1d6f02f12b40b6cf
Created April 26, 2015 10:24
creating an alternating color decoration for wordpress page builder rows & columns
/* creating an alternating color decoration*/
/* first row after header*/
.panel-grid:nth-child(1n+1) .panel-grid-cell:nth-child(1n) .blocks-content{
background-color: #E84036;
}
.panel-grid:nth-child(1n+1) .panel-grid-cell:nth-child(2n) .blocks-content{
background-color: #FECB0D;
}
@pascalwhoop
pascalwhoop / gist:e5f07c3711fe4b3014ca
Created July 6, 2015 11:35
wait-bar directive for angular material design. Shows wait bar once showEvent is emitted on rootScope and hides it again once hideEvent is emitted
/**
* @ngdoc directive
* @name frontendApp.directive:equals
* @description
* A directive to show and hide a loading bar. it takes two attributes (show-event and hide-event) which must be the event names it should listen on on the rootScope.
*/
.directive('waitBar', ['$rootScope', function ($rootScope) {
return {
restrict: 'E', // only activate on element attribute
link: function (scope, elem, attrs) {
#weather function
function weather() {
if [[ $1 != "in" ]]
then
CITY=$1
else
CITY=$2
fi
curl http://wttr.in/$CITY;
}
FILES=/Users/pbr/Documents/Code/bash/*
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
source $f
done
{
"AD": "Andorra",
"AL": "Albania",
"AT": "Austria",
"AX": "Åland Islands",
"BA": "Bosnia and Herzegovina",
"BE": "Belgium",
"BG": "Bulgaria",
"BY": "Belarus",
"CH": "Switzerland",
import {ICoordinate} from "./LiveMapModels";
import {TimeSpan} from "./UtilityInterfaces";
export interface IUser {
username: string;
size: number;
clientId: number;
language?: string;
uwb?: number;
#!/bin/bash
#requires sejda-console to be in the path as 'sejda'
#https://github.com/torakiki/sejda/releases/download/v2.7/sejda-console-2.7-bin.zip
if [ "$1" == "-h" ]; then
echo "Usage: pass the name of one file in the /in folder as a parameter. put all pdfs in an in/ folder"
exit 0
fi
rm -r out/
@pascalwhoop
pascalwhoop / clearAdPrefsOnFb.js
Created February 18, 2017 10:55
A small script that clicks all the buttons on the Facebook ad preferences screen to hide all ads and remove all interests. Maybe it neutralizes ads on FB and keeps me from being in a filter bubble?
//Instruction:
// 1. go here https://www.facebook.com/ads/preferences/?entry_product=ad_settings_screen
// 2. open dev console
// 3. paste code below and execute expandAll()
// 4. repeat for all categories that aren't shown simulaneously
function expandAll(){
var intr = setInterval(function(){
var btns = document.getElementsByClassName('_45yq'); //the class name of the expand buttons
let snackSpy = jasmine.createSpyObj('snackBar', ['open']);
//...
//....beforeEach, TestBed configurations etc
//...
it('should let listeners subscribe', function () {
expect(service._listeners.length).toBe(0);
service.addListener({
onLoading: () => {
import {Injectable} from "@angular/core";
import {MdSnackBar, MdSnackBarRef, SimpleSnackBar} from "@angular/material";
import {Observable} from "rxjs";
import {LoadingEventListener} from "./LoadingEventListener";
@Injectable()
export class VFeedbackService {
_listeners: LoadingEventListener[] = [];