Skip to content

Instantly share code, notes, and snippets.

View SIRHAMY's full-sized avatar
🐷
Loading...

Hamilton Greene SIRHAMY

🐷
Loading...
View GitHub Profile
@SIRHAMY
SIRHAMY / City.java
Created January 8, 2016 04:17
My WorldProblem solution.
public class City implements Municipality{
private int population;
private String name;
public City(String name, int population) {
this.name = name;
this.population = population;
}
@Override
@SIRHAMY
SIRHAMY / Main.java
Created January 8, 2016 04:09
WorldProblem Constructor Example
public class Main {
public static void main(String[] args) {
World myWorld = new World(
new Country("USA",
new State("NY",
new City("New York", 8143197)),
new City("LA", 3844829),
new City("Chicago", 2842518),
new District("Washington D.C.", 658893)),
new Country("Germany",
@SIRHAMY
SIRHAMY / isPalindrome.java
Created December 15, 2015 05:08
Java: Decides if given string is a Palindrome
public boolean isPalindrome(String s) {
for(int i = 0; i < s.length()/2; i++) {
if(s.charAt(i) != s.charAt(s.length() - i - 1)) {
return false;
}
}
return true;
}
<button class="btn" ng-click="toggleVisible('left')"
ng-class="{ active : isVisible('left') }">Toggle Left
</button>
<button class="btn" ng-click="toggleVisible('right')"
ng-class="{ active : isVisible('right') }">Toggle Right
</button>
@SIRHAMY
SIRHAMY / AngularCSSHide.css
Created July 30, 2015 03:38
Angular example using CSS to hide elements instead of ng-show and ng-hide
.chartdisplay img {
display: block;
height: 100%;
width: 100%;
}
.hide {
visibility: hidden;
opacity: 1;
}
<select ng-model="rightPdfChart"
ng-options="option.name for option in options">
</select>
@SIRHAMY
SIRHAMY / app.js
Created July 28, 2015 01:45
P5.js in Angular Application Example
angular.module('sirhamy', ['ngRoute', 'projects']);
angular.module('sirhamy').config( function($routeProvider) {
$routeProvider
.when('/main', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'control'
})
.when('/phantsaver', {
@SIRHAMY
SIRHAMY / app.js
Created July 23, 2015 04:18
Basic Angular App setup with routing implementing ngRoute
angular.module('myApp', ['ngRoute']);
angular.module('myApp').config( function($routeProvider) {
$routeProvider
.when('/main', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
})
.otherwise({
redirectTo: '/main'
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=/dev/null --disable-web-security
@SIRHAMY
SIRHAMY / SplunkChartCustomColors
Created July 2, 2014 22:38
Splunk Chart with custom colors by series
<module name="HiddenSavedSearch">
<param name="savedSearch">MySavedSearch</param>
<module name="HiddenChartFormatter">
<param name="charting.legend.labels">["Normal Response", "Slow Response]</param>
<param name="charting.seriesColors">[0x00CC23,0x2428CC]</param>
<module name="JSChart">
<param name="maxResultCount">750</param>
</module>
</module>