Skip to content

Instantly share code, notes, and snippets.

View alexandregz's full-sized avatar
🎯
Focusing

Alexandre Espinosa Menor alexandregz

🎯
Focusing
View GitHub Profile
@alexandregz
alexandregz / README.md
Created December 2, 2015 07:07 — forked from Coeur/README.md
Write to NTFS on OSX Yosemite and El Capitan
@alexandregz
alexandregz / C_test.c
Last active October 1, 2015 15:39
Test perl/perl6/php/php7/C
#include <stdio.h>
#include <math.h>
int main() {
double s=0;
for(int i=1; i<=10000; i++) {
s=s+(1/pow(i, 2));
printf("%d %lf %lf %lf\n", i, s, pow(i,2), 1/pow(i,2) );
}

Quick install PHP 7.0 (phpng):

1. Install depends PHP 7.0 (phpng)
$ brew install autoconf automake bison27 gd freetype t1lib mariadb gettext zlib mcrypt
Add support for Bison 3.x

curl -L https://github.com/php/php-src/pull/685.diff | patch -p1

@alexandregz
alexandregz / baller_motd.md
Last active July 10, 2019 01:44 — forked from thcipriani/baller_motd.md
Using img2ponysay to create baller /etc/motd message

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
    • Won't compile under OSX something about illegal characters…I use have an Ubuntu server at Digital Ocean
    • If anyone gets this working on a Mac I'd love to know
  • Imagemagick
@alexandregz
alexandregz / error.log
Last active August 29, 2015 14:26
error using carthage with swiftshell
[2015-08-04 00:01:41] alex@vostok:/tmp/test$ carthage bootstrap
*** No Cartfile.resolved found, updating dependencies
*** Fetching SwiftShell
*** Checking out SwiftShell at "4aeb5d7daa4c87d07e937c0238d8476dfcb809be"
*** xcodebuild output can be found in /var/folders/lv/tlgk81yd4kn23dkfv9qpdcr40000gn/T/carthage-xcodebuild.DpHcij.log
*** Building scheme "SwiftShell" in SwiftShell.xcodeproj
2015-08-04 00:01:57.120 xcodebuild[12527:9376026] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-7546/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:77
Details: Failed to load dependencies output contents from ``/Users/alex/Library/Developer/Xcode/DerivedData/SwiftShell-awlfnhhukkknlcatgirterfmqujr/Build/Intermediates/SwiftShell.build/Release/SwiftShell.build/Objects-normal/x86_64/FileHandle.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “FileHandle.d” couldn’t be opened beca
@alexandregz
alexandregz / check_idle_time.sh
Created July 24, 2015 20:58
check idle time into OSX
#!/bin/sh
#
# From http://stackoverflow.com/questions/17964660/how-to-detect-if-user-is-away-in-osx
#
ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF/1000000000; exit}'
<?php
/*
Install:
1) create a folder: disablecsrf inside 'plugins/' directory.
2) place this file there and name it: disablecsrf.php
3) go to config/config.inc.php, and add it to plugins, like:
$config['plugins'] = array('disablecsrf');
CSRF should now be disabled for login.
*/
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
<?php
// Load WordPress
require_once 'path/to/www/wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
// Set the timezone so times are calculated correctly
date_default_timezone_set('Europe/London');
// Create post
@alexandregz
alexandregz / anybar_intermitent.sh
Last active August 29, 2015 14:18
Test to use a intermitent light with AnyBar
#!/bin/bash
while [ 1 ]; do
echo -n "red" | nc -4u -w0 localhost 1738 ; sleep 1; echo -n "white" | nc -4u -w0 localhost 1738; sleep 1;
done
# onliner
# while [ 1 ]; do echo -n "red" | nc -4u -w0 localhost 1738 ; sleep 1; echo -n "white" | nc -4u -w0 localhost 1738; sleep 1; done