Skip to content

Instantly share code, notes, and snippets.

View tvl83's full-sized avatar

Thomas Le tvl83

  • Reality Flux, LLC
  • Oklahoma City, OK
  • X @tvl83
View GitHub Profile
@tvl83
tvl83 / gist:5166605
Created March 15, 2013 00:47
rvm --trace info system
```bash
# rvm --trace info system
+ [[ -n '' ]]
+ set -o errtrace
+ export 'PS4=+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ PS4='+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ 1363308397.211471000 /scripts/cli : __rvm_parse_args() 715 > [[ -z '' ]]
+ 1363308397.213078000 /scripts/cli : __rvm_parse_args() 715 > [[ -n '' ]]
+ 1363308397.214566000 /scripts/cli : __rvm_parse_args() 718 > [[ error == '' ]]
+ 1363308397.217151000 /scripts/cli : __rvm_parse_args() 718 > [[ 0 -eq 1 ]]
@tvl83
tvl83 / gist:5166983
Created March 15, 2013 02:09
cat /var/log/messages
Mar 14 19:05:41 flux shutdown[28624]: shutting down for system halt
Mar 14 19:05:41 flux init: Switching to runlevel: 0
Mar 14 19:05:49 flux xinetd[1625]: Exiting...
Mar 14 19:05:50 flux exiting on signal 15
Mar 14 19:06:06 flux syslogd 1.4.1: restart.
Mar 14 19:06:08 flux kernel: klogd 1.4.1, log source = /proc/kmsg started.
Mar 14 19:06:08 flux iscsid: iSCSI logger with pid=1557 started!
Mar 14 19:06:08 flux iscsid: Missing or Invalid version from /sys/module/scsi_transport_iscsi/version. Make sure a up to date scsi_transport_iscsi module is loaded and a up todate version of iscsid is running. Exiting...
Mar 14 19:06:08 flux nsd[1590]: nsd started (NSD 3.2.14), pid 1590
Mar 14 19:06:10 flux xinetd[1628]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
@tvl83
tvl83 / assetdump.bat
Last active January 4, 2016 00:49
These are three quick batch files I created to make development in symfony a little easier (in windows specifically). the first just updates the fixtures when you make a change and want to quickly reload them The second updateschema.bat drops the schema, updates it, and then loads the fixtures in both test and dev environment. this prevents a lo…
php app/console assetic:dump
php app/console assetic:dump --env=prod --no-debug
sudo pear channel-discover pear.pdepend.org
sudo pear remote-list -c pdepend
sudo pear install pdepend/PHP_Depend-1.1.4
sudo pear channel-discover pear.phpmd.org
sudo pear remote-list -c phpmd
sudo pear install phpmd/PHP_PMD-1.5.0
sudo pear install pdepend/PHP_CodeSniffer_Standards_PDepend2-1.0.0
sudo service php5-fpm restart
Check the video to configure PHPMD and PHPCS with PHPStorm.
@tvl83
tvl83 / FormType.php
Created January 30, 2014 18:24
Custom Form Choices
<?php
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('status', 'choice', array('choices' => array(
'PENDING' => 'PENDING',
'APPROVED' => 'APPROVED',
'DENIED' => 'DENIED',
'REVOKED' => 'REVOKED'
)))
@tvl83
tvl83 / error.txt
Created January 31, 2014 05:25
FOSUserBundle adapting it to my own uses with a custom form. I am running into issues with the translator. I opted to just remove all traces of trans({}, translation_domain) and things are beginning to work. However, I just ran into another issue with line 81 of `form_div_layout.html.twig` which is line 14 below. {{ separator }}. instead of just…
An exception has been thrown during the rendering of a template ("Error parsing YAML.") in kernel.root_dir/Resources/views/forms.html.twig at line 81.
500 Internal Server Error - Twig_Error_Runtime
@tvl83
tvl83 / gist:9218323
Created February 25, 2014 21:33
when including jquery mobile and angular
TypeError: Cannot call method 'charAt' of undefined
at Object.LocationHashbangUrl.$$parse (http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:15705:49)
at http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:16199:39
at Scope.$eval (http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:18939:44)
at Scope.$digest (http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:18765:53)
at http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:16208:61
at http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:11217:17
at Array.forEach (native)
at forEach (http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:7265:21)
at fireUrlChange (http://local/Simulator/assets/lib/js/ionic/ionic.bundle.js:11216:13)
@tvl83
tvl83 / app.js
Created June 4, 2014 11:43
For some reason the routes are not getting caught. When I click a link it hits the server and rails fails to find a route.
var app = angular.module("MyApp", ['ngResource', 'ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when( '/bundles/', { templateUrl: '../templates/bundlesIndex.html', controller: 'BundlesCtrl' } )
.when( '/bundles/:nameSlug', { templateUrl: '../templates/bundlesView.html', controller: 'BundlesCtrl' } )
.otherwise({ templateUrl: '../templates/homeIndex.html', controller: 'MainCtrl' } );
}]);
@tvl83
tvl83 / moreinfo.md
Created July 29, 2017 23:41
Does anyone know how to insert a variable(a string) into a regular expression statement and then take that regex expression (not a string data type) and put it in a javaobject ? I am using MongoDB (it's an already made db I am only querying against) and to query a colleciton I need to use RegEx. I have the expression I need but it needs to be dy…

when I sent a post with {"username":"blah"} as the payload I need a response of

{
    "title": /.*@blah.*/i,
    "$or": [
        {
            "body": /.*@blah.*/i
 }
obj: { title: /.*@followbtcnews.*/i,
'$or': [ { body: /.*@followbtcnews.*/i } ] }
stringify: {"title":{},"$or":[{"body":{}}]}
parsed: { title: {}, '$or': [ { body: {} } ] }
{ title: /.*@followbtcnews.*/i,
'$or': [ { body: /.*@followbtcnews.*/i } ] }